<template>
	<view class="content">
		<self-navbar title='账号安全'></self-navbar>
		<view class="infoCells">
			<u-cell-group title="帐号绑定:">
				<u-cell icon="account-fill" title="手机绑定" :value="userInfo.telePhone" @click="phone"></u-cell>
				<u-cell icon="email-fill" title="邮箱绑定" :value="userInfo.email" @click="email"></u-cell>
			</u-cell-group>
		</view>
		<view class="infoCells">
			<u-cell-group title="密码:">
				<u-cell icon="lock-fill" title="登陆密码" value="修改" @click="modifypassword"></u-cell>
			</u-cell-group>
		</view>
		<view class="infoCells">
			<u-cell-group title="帐号:">
				<u-cell icon="minus-people-fill" title="注销帐号" value="" @click="logout_account"></u-cell>
			</u-cell-group>
		</view>

	</view>
</template>
<script>
	import {
		toast,
		clearStorageSync,
		setStorageSync,
		getStorageSync,
		useRouter
	} from '@/utils/utils.js'
	export default {
		data() {
			return {
				userInfo: uni.getStorage('userInfo') || {},
				version: "",
				showModal: false,
			}
		},
		onLoad(op) {
			//this.id  = op.id
		},
		onShow() {},
		onReady() {
			const that = this
			uni.getSystemInfo({
				success: function(res) {
					console.log("res", res)
					that.version = res.appVersion
				}
			})
		},
		methods: {
			confirmExit() {
				uni.removeStorageSync('token')
				this.showModal = false
				useRouter('/pages/public/login', {}, 'reLaunch')
			},

			modifypassword() {
				useRouter('/pages/mine/account/password', {}, 'navigateTo')
			},
			email() {
				useRouter('/pages/mine/account/email', {}, 'navigateTo')
			},
			phone() {
				useRouter('/pages/mine/account/phone', {}, 'navigateTo')
			},
			logout_account() {
				useRouter('/pages/mine/account/logout_account', {}, 'navigateTo')
			}
		}
	}
</script>
<style lang="scss" scoped>
	page {
		background: #f2f2f2
	}
</style>